<?php
/**
 * (crontab) 解析-sp-请求报告
 */
namespace App\Crontab\Daily\SpApi;

use App\Jobs\AmazonApi\SpApi\GrabParseReport as GGrabParseReport;
use App\Models\Basics\AmazonAccount;
class GrabParseReport
{
    /**
     * 亚马逊报告-通用
     * @param $reportType
     * @param $where
     */

    public static function grab($reportType,$where){
        $where['api'] = 1;
        $accounts = AmazonAccount::optionsForApi($where);
        $re = [];
        foreach ($accounts as $account){
            GGrabParseReport::dispatch($account,$reportType)->onQueue('sp-report');
            $re[$account->id] = true;
        }
        var_dump($re);
    }
}
